'use strict';

const Controller = require('egg').Controller;

class NoteController extends Controller {
  async addNote() {
    const { ctx } = this;
    const { title, noteValueType, noteType, mainFigureAddress, noteContent } = ctx.request.body;
    const NoteParam = {
      title,
      noteValueType,
      noteType,
      mainFigureAddress,
      noteContent,
    };
    console.log('addNoteController');
    console.log('NoteParam', NoteParam);
    ctx.body = await ctx.service.note.addNote(NoteParam);
    ctx.body = { code: 200, msg: '新增成功' };
  }
}

module.exports = NoteController;
